package edu.cornell.cubooks.dao;

import java.util.Set;

import edu.cornell.cubooks.domain.Bid;
import edu.cornell.cubooks.domain.Posting;
import edu.cornell.cubooks.domain.User;

/**
 * Data Access Object interface for biding.
 * 
 * @author CUBooks Team
 */
public interface BidDao extends GenericDao<Bid, Integer> {
	/**
	 * Loads bids for given posting.
	 * 
	 * @param posting
	 * @return List of Bids.
	 */
	public Set<Bid> getBidsForPosting(Posting posting);
	
	/**
	 * Check if placed Bid is greater than current Bid.
	 * 
	 * @param price
	 * @return true if placed Bid greater than current Bid.
	 */
	public boolean isPlacedBidGreaterthanCurrentBid(Float price, Posting posting);
	
	/**
	 * Loads set of bids for given user. 
	 * 
	 * @param user
	 * @return Set of Bids
	 */
	public Set<Bid> getAllForGivenUser(User user);
	
	/**
	 * Places bid from a given user.
	 * 
	 * @param bid
	 * @return true if bid was place
	 */
	public void placeBid(Bid bid);
	
}
